package gewu.suleju.util;

import org.springframework.stereotype.Component;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Component
public class StringOperateUtil {
    public boolean isNumeric(String str){
        Pattern pattern = Pattern.compile("[0-9]*");
        Matcher isNum = pattern.matcher(str);
        if( !isNum.matches() ){
            return false;
        }
        return true;
    }

    public Integer toNumeric(String str){
        return new Integer(str);
    }

    public String[] stringIncise(String str,String incise) {
        String inciseRegular = "["+incise+"]+";
        return str.split(inciseRegular); // 分割字符串
    }
}
